﻿@model IEnumerable<WebApplication1.Models.Entities.Course>

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>

<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.LongDescription)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DurationHours)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Level)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ImageUrl)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PreviewVideoUrl)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsPublished)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsFeatured)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.IsActive)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreatedAt)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.UpdatedAt)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.PublishedAt)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Instructor)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Category)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LongDescription)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Price)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DurationHours)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Level)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ImageUrl)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.PreviewVideoUrl)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.IsPublished)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.IsFeatured)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.IsActive)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreatedAt)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdatedAt)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.PublishedAt)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Instructor.Id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Category.Name)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.CourseId">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.CourseId">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.CourseId">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
